// components/orders/unpay.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    title: '待支付订单',
    subTitle: '请及时完成支付，避免订单超时取消',
    category: '食品(2个商品)',
    orderNo: '#20230815001',
    countdown: '2小时30分',
    goods: [
      {
        id: 1,
        name: '鲜肉小笼包',
        price: '59.99',
        qty: 1,
        status: '待支付',
        pic: 'https://aimg8.dlssyht.cn/u/2011304/ueditor/image/1006/2011304/1683099058693241.jpg'
      },
      {
        id: 2,
        name: '黑豆核桃芝麻糊',
        price: '89.00',
        qty: 1,
        status: '待支付',
        pic: 'https://ts1.tc.mm.bing.net/th/id/OIP-C.Kp5W_62axVDcUkix9ENJTQHaHa?rs=1&pid=ImgDetMain&o=7&rm=3'
      }
    ],
    total: '148.99'

  },

  /**
   * 组件的方法列表
   */
  methods: {

    viewDetail() {
        wx.showToast({ title: '查看详情', icon: 'none' });
      },
    
      payNow() {
        wx.showModal({
          title: '确认支付',
          content: `需支付 ¥${this.data.total}`,
          success: res => {
            if (res.confirm) {
              wx.showToast({ title: '支付成功', icon: 'success' });
            }
          }
        });
      }

  }
})